#pragma once

#include "cpu.h"
#include "ppu.h"
#include <fstream>
using namespace std;

class connector
{
public:
	connector(const char *file);
	~connector(void);
public:
	ifstream inf;
	BYTE bank_num;/* 16KB */
	BYTE vrom_num;/* 8KB  */
	BOOL horizon; /*horizontal mirroring*/
	BOOL battery;
	BOOL trainer;
	BOOL fourscreen;
	BOOL l_mapper[4],h_mapper[4];
	BYTE ram_num;/* 8KB */
private:	
	BOOL is_legal_nes();
	BYTE r_bank_num();
	BYTE r_vrom_num();
	BOOL is_horizon();
	BOOL exist_battery();
	BOOL exist_trainer();
	BOOL is_fourscreen();
	void r_l_mapper();
	void r_h_mapper();
	BYTE r_ram_num();
};
